<?php

namespace Modules\Admin\Policies;

use Illuminate\Auth\Access\HandlesAuthorization;
use App\User;
class UserPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     *判断用户是否可以进行删除，只有is_admin为1，即超级管理员才可以进行删除
     *
     */
    public function delete(User $user,User $model){
        return $user->is_admin && $model->id != $user->id;
    }
}
